﻿using Sustainalytics.ClientDW.Synchronization.SyncESGData.CorporateDataLogic;
using Sustainalytics.ClientDW.Synchronization.SyncESGData.Tests.Helpers;
using Sustainalytics.Synchronization.Interface;
using System.Threading.Tasks;
using Xunit;

namespace Sustainalytics.ClientDW.Synchronization.SyncESGData.Tests
{
    public class CoreEsgQueriesTests
    {
        private readonly ICoreEsgCompaniesIdsQuery coreEsgCompaniesIdsQuery;

        public CoreEsgQueriesTests()
        {
            ILogger logger = new TestLogger();

            var container = SimpleInjectorConfig.Register(logger, TestConnectionStrings.GAConnectionStrings);

            coreEsgCompaniesIdsQuery = container.GetInstance<EsgCompaniesIdsQuery>();
        }

        [Fact]
        public async Task GetEsgCompaniesIds()
        {
            var coreEsgCompaniesIds = await coreEsgCompaniesIdsQuery.GetAsync();
            Assert.NotEmpty(coreEsgCompaniesIds.CompaniesWithActiveResearch);
            Assert.NotEmpty(coreEsgCompaniesIds.InvalidatedCompanies);
        }
    }
}
